#include <stdio.h>
#include <string.h>
#include <stdlib.h>
//int mes_send(char *request,int len){
//	Write(socked, request,len);
//}

char *mes_build_send(char *id,char* news){
	char * ret;
	ret  = malloc(sizeof(char)*(strlen(id)+strlen(news)+6));
	strcpy(ret,"send");
	strcat(ret," ");
	strcat(ret,id);
	strcat(ret," ");
	strcat(ret,news);
	return ret;
}

char *mes_build_search(char *id1,char *id2,char* time){
	char *ret;
	ret  = malloc(sizeof(char)*(strlen(id1)+strlen(id2)+strlen(time)+9));
	strcpy(ret,"search");
	strcat(ret," ");
	strcat(ret,id1);
	strcat(ret," ");
	strcat(ret,id2);
	strcat(ret," ");
	strcat(ret,time);
	return ret;

}
char *mes_build_back(char *sender,char *adressee){
	char *ret;
	ret = malloc(sizeof(char)*(strlen(sender)+strlen(adressee)+6));
	strcpy(ret,"back");
	strcat(ret," ");
	strcat(ret,sender);
	strcat(ret," ");
	strcat(ret,adressee);
}
int main(void){

	char a[]="12345";
	char b[]="00000";
	char c[]="asdfasdf";
	printf("%s\n",mes_build_back(a,b));

}
